package com.ky.facescan.api.exception;

/**
 * 异常基类
 */
public class BaseException extends Exception {


    /*网络错误*/
    public static final String NETWORK_ERROR = "0x1";
    /*http_错误*/
    public static final String HTTP_ERROR = "0x2";
    /*json错误*/
    public static final String JSON_ERROR = "0x3";
    /*未知错误*/
    public static final String UNKNOWN_ERROR = "0x4";
    /*运行时异常-包含自定义异常*/
    public static final String RUNTIME_ERROR = "0x5";
    /*无法解析该域名*/
    public static final String UNKNOWN_HOST_ERROR = "0x6";
    /*连接网络超时*/
    public static final String SOCKET_TIMEOUT_ERROR = "0x7";
    /*无网络连接*/
    public static final String SOCKET_ERROR = "0x8";
    // 服务器错误
    public static final String ERROR_API_SYSTEM="10000";
    // 登录错误，用户名密码错误
//    public static final String  ERROR_API_LOGIN="101";
    //调用无权限的API
    public static final String ERROR_API_NO_PERMISSION="10002";
    //账户被冻结
    public static final String ERROR_API_ACCOUNT_FREEZE="10003";
    /**
     * token失效
     */
    public static final String ERROR_TOKEN="100";
    // http
    public static final String ERROR_HTTP_400="400";

    public static final String ERROR_HTTP_404="404";

    public static final String ERROR_HTTP_405="405";

    public static final String ERROR_HTTP_500="500";

    public static final String ERROR_HTTP_502="502";


    private String code;

    private String displayMessage;

    public BaseException() {
    }

    public BaseException(String code, String displayMessage) {
        this.code = code;
        this.displayMessage = displayMessage;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDisplayMessage() {
        return displayMessage;
    }

    public void setDisplayMessage(String displayMessage) {
        this.displayMessage = displayMessage;
    }
}
